<?php if($sf_user->hasCredential("magasinier")){?>
<h1>Liste de Transports</h1>

<div id="list">
<table>
  <thead>
    <tr>
      <th>Nom</th>
      <th>Immatriculation</th>
      <th>Marque</th>
      <th>Date</th>
    </tr>
  </thead>
  <tbody>
  
    <?php foreach ($transports as $key => $transport): 
	    if($key % 2 == 0) {
	    	$style = "background-color: #A9CADD";
	    } else {
	    	$style = "background-color: #E6F7FE";
	    }	     
    ?>
    <tr>
      <td style="<?php echo $style?>"><a href="<?php echo url_for('transport/show?id='.$transport->getId()) ?>"><?php echo $transport->getNom() ?></a></td>
      <td style="<?php echo $style?>"><?php echo $transport->getImmatriculation() ?></td>
      <td style="<?php echo $style?>"><?php echo $transport->getMarque() ?></td>
      <td style="<?php echo $style?>"><?php echo $transport->getDate() ?></td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
</div>
<br />
<a href="<?php echo url_for('transport/new') ?>">Nouveau transport</a>
<?php
}else{
	echo "Droits insuffisants.";
} ?>